<?php 
    require_once('header_sidebar.php');
    require_once('Class/connexionDB.Class.php');

    $db             = new connexionDB();
    $country        = $db->getCountry();
    
    $groups         = $db->getGroupForIdAccount($session->id_account);
    
    $team           = $db->getTeam();
    $name_rater     = $db->getNameRater();
    $consultant     = $db->getConsultantName();
    $calibration    = $db->getCalibration();
    $manager        = $db->getManagerList();
    $form           = $db->getEvaluationForm();
?>
<link rel="stylesheet" href="js/plugins/chosen/chosen.min.css">
<aside class="right-side">
	    <!-- Content Header (Page header) -->
	    <section class="content-header">
	        <h1>
	            <?php echo $translate->translate('ReportTitle'); ?>
	        </h1>
	        <ol class="breadcrumb">
	            <li><i class="fa fa-table"></i> <?php echo $translate->translate('ReportTitle'); ?></li>
	        </ol>
	    </section>
	    <section class="content">
            <div class="">
                <!-- TABLE 1 -->
                <div class="col-md-12">
                    <div class="box box-info col-md-12">
                    <!-- general form elements -->
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingMark'); ?> :</h3>
                            <div class="box-tools pull-right" data-toggle="tooltip">
                                <div class="btn-group" data-toggle="btn-toggle">
                                    <button id="nb" type="button" class="btn btn-default btn-sm active"><?php echo $translate->translate('nb'); ?></button>
                                    <button id="moy" type="button" class="btn btn-default btn-sm"><?php echo $translate->translate('avg'); ?></button>
                                    <button id="repartition" type="button" class="btn btn-default btn-sm"><?php echo $translate->translate('rpt'); ?></button>
                                </div>
                            </div>
                        </div>
                        <form id="form_stat_1" role="form">
                            <div class="box-body">
                                <div id="daterange_div" class="form-group">
                                    <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" name="ratingDate" id="daterange"/>
                                    </div><!-- /.input group -->
                                </div><!-- /.form group -->
                                <div class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?> :</label>
                                    <select id="country" name="county" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($country as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?> :</label>
                                    <select id="group" name="group" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($groups as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('descriptionTeam'); ?> :</label>
                                    <select id="team" name="team" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($team as $value) : ?>
                                            <option value="<?php echo $value['team']; ?>"><?php echo $value['team']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('NameRater'); ?> :</label>
                                    <select id="name_rater" name="name_rater" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($name_rater as $value) : ?>
                                            <option value="<?php echo $value['name_rater']; ?>"><?php echo $value['name_rater']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('nameEval'); ?> :</label>
                                    <select id="name_form" name="name_form" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($form as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                            </div>
                            <div class="box-footer">
                                <div type="submit" class="btn btn-primary" onclick="generateTable('result_stat_1');">Submit</div>
                            </div>
                            <div class="box-footer col-md-12">
                                <div id="result_stat_1" style="display:none;" class="col-md-12">
                                    <div class="box col-md-12">
                                        <div class="box-header">
                                            <h3 class="box-title">Statistiques : </h3>
                                        </div>
                                        <br>
                                        <center id="loading_stat_1"><img src="img/ajax-loader1.gif"></center>
                                        <div id="empty_table" class="alert alert-danger alert-dismissable" hidden>
                                            <i class="fa fa-ban"></i>
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <b>Tableau vide !</b>
                                            Aucune évaluation correspond aux critères que vous avez entrés.
                                        </div>
                                        <div class="box-body table-responsive col-md-12 box-body table-responsive col-md-12" id="entire_table">
                                            <div  id="table_stats">
                                                <table id="result_stat_eval" class="table table-bordered table-striped">
                                                    <thead>
                                                        <tr>
                                                            <th><?php echo $translate->translate('Time'); ?></th>
                                                            <th><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?></th>
                                                            <th><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?></th>
                                                            <th><?php echo $translate->translate('descriptionTeam'); ?></th>
                                                            <th><?php echo $translate->translate('NameRater'); ?></th>
                                                            <th><?php echo $translate->translate('evaluationForm'); ?></th>
                                                            <th id="title_result"><?php echo $translate->translate('nbRating'); ?></th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <tr id="before">
                                                            <td><b>Total</b></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td></td>
                                                            <td id="total"></td>
                                                        </tr>
                                                        <tr id="result_line" hidden>
                                                            <td class="daterange_table"></td>
                                                            <td id="country_table"></td>
                                                            <td id="group_table"></td>
                                                            <td id="team_table"></td>
                                                            <td id="name_rater_table"></td>
                                                            <td id="eval_name"></td>
                                                            <td id="nb_eval_table"></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                            <div class="box-footer pull-right">
                                                <a download="Table_stat_one.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_eval', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>
                                        <div class="box-body table-responsive col-md-12" id="table_distribution" style="display:none;">
                                            <div id="table_stats_distribution">
                                                <table id="result_stat_distribution" class="table table-bordered table-striped">
                                                    <thead>
                                                        <tr>
                                                            <th><?php echo $translate->translate('Time'); ?></th>
                                                            <th><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?></th>
                                                            <th><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?></th>
                                                            <th><?php echo $translate->translate('descriptionTeam'); ?></th>
                                                            <th><?php echo $translate->translate('NameRater'); ?></th>
                                                            <th><?php echo $translate->translate('evaluationForm'); ?></th>
                                                            <th id="title_result"><?php echo $translate->translate('nbRating'); ?></th>
                                                            <th>Tranche</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody>
                                                        <tr>
                                                            <td class="daterange_table"></td>
                                                            <td class="country_name"></td>
                                                            <td class="group_name"></td>
                                                            <td class="team"></td>
                                                            <td class="name_rater"></td>
                                                            <td id="eval_form_1"></td>
                                                            <td id="first_slice"></td>
                                                            <td><span class="badge bg-red">0/100<i class="fa fa-fw fa-arrows-h"></i>25/100</span></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="daterange_table"></td>
                                                            <td class="country_name"></td>
                                                            <td class="group_name"></td>
                                                            <td class="team"></td>
                                                            <td class="name_rater"></td>
                                                            <td id="eval_form_2"></td>
                                                            <td id="second_slice"></td>
                                                            <td><span class="badge bg-yellow">25/100<i class="fa fa-fw fa-arrows-h"></i>50/100</span></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="daterange_table"></td>
                                                            <td class="country_name"></td>
                                                            <td class="group_name"></td>
                                                            <td class="team"></td>
                                                            <td class="name_rater"></td>
                                                            <td id="eval_form_3"></td>
                                                            <td id="third_slice"></td>
                                                            <td><span class="badge bg-blue">50/100<i class="fa fa-fw fa-arrows-h"></i>75/100</span></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="daterange_table"></td>
                                                            <td class="country_name"></td>
                                                            <td class="group_name"></td>
                                                            <td class="team"></td>
                                                            <td class="name_rater"></td>
                                                            <td id="eval_form_4"></td>
                                                            <td id="fourth_slice"></td>
                                                            <td><span class="badge bg-green">75/100<i class="fa fa-fw fa-arrows-h"></i>100/100</span></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                            <div class="box-footer pull-right">
                                                <a download="Table_stat_one.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_distribution', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>                                    
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="row">
                    <!-- TABLE 2 -->
                    <div class="col-md-6">
                        <div class="box box-info col-md-12">
                            <div class="box-header">
                                <h3 class="box-title"><?php echo $translate->translate('markDistribution'); ?> :</h3>
                            </div>
                            <form id="form_stat_2" role="form">
                                <div class="box-body col-md-12">
                                     <div id="daterange_2_div" class="form-group">
                                        <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                        <div class="input-group">
                                            <div class="input-group-addon">
                                                <i class="fa fa-calendar"></i>
                                            </div>
                                            <input type="text" class="form-control pull-right" id="daterange_2"/>
                                        </div>
                                    </div>
                                    <div id="team_stat_2_div" class="form-group">
                                        <label><?php echo $translate->translate('descriptionTeam'); ?> :</label>
                                        <div class="input-group">
                                            <select id="team_stat_2" class="form-control chosen-select">
                                                <option value="">All</option>
                                                <?php foreach ($team as $value) : ?>
                                                    <option value="<?php echo $value['team']; ?>"><?php echo $value['team']; ?></option>
                                                <?php endforeach ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('nameEval'); ?> :</label>
                                        <div class="input-group">
                                            <select id="name_form_stat_2" name="name_form" class="form-control chosen-select">
                                                <option value="">All</option>
                                                <?php foreach ($form as $value) : ?>
                                                    <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                                <?php endforeach ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12">
                                        <div type="submit" class="btn btn-primary" onclick="generateTableNbRatingOver('result_stat_2');">
                                            <?php echo $translate->translate('Calculate'); ?>
                                        </div>
                                        <div class="box-footer col-md-12" id="result_stat_2" hidden>
                                            <div class="box">
                                                <div class="box-header">
                                                    <h3 class="box-title"><?php echo $translate->translate('nbRatingOverBellow'); ?></h3>
                                                </div>
                                                <center id="loading_stat_2"><img src="img/ajax-loader1.gif"></center>
                                                <div class="box-body">
                                                    <div class="box-body no-padding">
                                                        <table class="table table-condensed" id="result_stat_over_under">
                                                            <tbody>
                                                                <tr>
                                                                    <th></th>
                                                                    <th><?php echo $translate->translate('evaluationForm'); ?></th>
                                                                    <th>Total</th>
                                                                    <th style="width: 40px">%</th>
                                                                </tr>
                                                                <tr>
                                                                    <td>Nombre de note supérieur à 50/100</td>
                                                                    <td id="eval_form_over"></td>
                                                                    <td id="nb_over"></td>
                                                                    <td><span id="nb_over_pr" class="badge bg-green"></span></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Nombre de note inférieur à 50/100</td>
                                                                    <td id="eval_form_under"></td>
                                                                    <td id="nb_under">
                                                                    <td><span id="nb_under_pr" class="badge bg-red"></span></td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <div class="box-footer pull-right">
                                                    <a download="Table_stat_second.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_over_under', 'Table stats');">
                                                        <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <!-- TABLE 3 -->
                    <div class="col-md-6">
                        <div class="box box-info col-md-12">
                            <div class="box-header">
                                <h3 class="box-title"><?php echo $translate->translate('trackingAverage'); ?> :</h3>
                                <div class="box-tools pull-right" data-toggle="tooltip">
                                    <div class="btn-group" data-toggle="btn-toggle">
                                        <button id="nb_consult" type="button" class="btn btn-default btn-sm type-request active"><?php echo $translate->translate('nb'); ?></button>
                                        <button id="moy_consult" type="button" class="btn btn-default btn-sm type-request"><?php echo $translate->translate('avg'); ?></button>
                                    </div>
                                </div>
                            </div>
                            <form id="form_stat_3" role="form">
                                <div class="box-body col-md-12">
                                     <div id="daterange_3_div" class="form-group">
                                        <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                        <div class="input-group">
                                            <div class="input-group-addon">
                                                <i class="fa fa-calendar"></i>
                                            </div>
                                            <input type="text" class="form-control pull-right" id="daterange_3"/>
                                        </div>
                                    </div>
                                    <div id="div_consult">
                                        <div id="name_consultant_stats_3_div" class="form-group">
                                            <label><?php echo $translate->translate('Consultant'); ?> :</label>
                                            <div class="input-group">
                                                <select id="name_consultant_stats_3" class="form-control chosen-select">
                                                    <?php foreach ($consultant as $value) : ?>
                                                        <option value="<?php echo $value['name_consultant'];?>"><?php echo $value['name_consultant'];?></option>
                                                    <?php endforeach ?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('nameEval'); ?> :</label>
                                        <div class="input-group">
                                            <select id="name_form_stat_3" name="name_form" class="form-control chosen-select">
                                                <option value="">All</option>
                                                <?php foreach ($form as $value) : ?>
                                                    <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                                <?php endforeach ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12">
                                        <div type="submit" class="btn btn-primary" onclick="generateTableAverage();">
                                            <?php echo $translate->translate('Calculate'); ?>
                                        </div>
                                        <div class="box-footer col-md-12" id="result_stat_3_nb" hidden>
                                            <div class="box">
                                                <div class="box-header">
                                                    <h3 class="box-title">Nombre d'évaluation</h3>
                                                </div>
                                                <div class="box-body">
                                                    <div class="box-body no-padding">
                                                        <table class="table table-bordered table-striped" id="result_stat_nb">
                                                            <thead>
                                                                <th><?php echo $translate->translate('Time'); ?></th>
                                                                <th><?php echo $translate->translate('Consultant'); ?></th>
                                                                <th>Nombre d'évaluation</th>
                                                            </thead>
                                                            <tbody>
                                                                <tr>
                                                                    <td id="time_stats_3_nb"></td>
                                                                    <td id="consultant_stats_3_nb"></td>
                                                                    <td id="number"></td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <div class="box-footer pull-right">
                                                    <a download="Table average group.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_nb', 'Table stats');">
                                                        <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="box-footer col-md-12" id="result_stat_3" hidden>
                                            <div class="box">
                                                <div class="box-header">
                                                    <h3 class="box-title">Note moyenne conseiller / Note moyenne du groupe</h3>
                                                </div>
                                                <div class="box-body">
                                                    <div class="box-body no-padding">
                                                        <table class="table table-bordered table-striped" id="result_stat_avg_grp">
                                                            <thead>
                                                                <th><?php echo $translate->translate('Time'); ?></th>
                                                                <th><?php echo $translate->translate('Consultant'); ?></th>
                                                                <th>Note moyenne</th>
                                                                <th>Note moyenne par groupe de CC</th>
                                                            </thead>
                                                            <tbody>
                                                                <tr>
                                                                    <td id="time_stats_3"></td>
                                                                    <td id="consultant_stats_3"></td>
                                                                    <td id="average_mark"></td>
                                                                    <td id="average_mark_grp"></td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                                <div class="box-footer pull-right" id="average_table_export">
                                                    <a download="Table average group.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_avg_grp', 'Table stats');">
                                                        <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- TABLE 6 -->
                <div class="col-md-12">
                    <div class="box box-info col-md-12">
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingCalibration'); ?> :</h3>
                        </div>
                        <form id="form_stat_6" role="form">
                            <div class="box-body col-md-12">
                                <div id="daterange_6_div" class="form-group">
                                    <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" id="daterange_6"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?> :</label>
                                    <select id="group_stat_6" name="group" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($groups as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('descriptionTeam'); ?> :</label>
                                    <select id="team_stat_6" name="team" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($team as $value) : ?>
                                            <option value="<?php echo $value['team']; ?>"><?php echo $value['team']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('NameRater'); ?> :</label>
                                    <select id="name_rater_stat_6" name="name_rater" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($name_rater as $value) : ?>
                                            <option value="<?php echo $db->getIdRaterByName($value['name_rater']); ?>"><?php echo $value['name_rater']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="box-footer col-md-12">
                                    <div type="submit" class="btn btn-primary" onclick="generateTableCalibration();">
                                        <?php echo $translate->translate('Calculate'); ?>
                                    </div><br>
                                    <div class="box-footer col-md-12">
                                        <div id="empty_table_stat_6" class="alert alert-danger alert-dismissable" hidden>
                                            <i class="fa fa-ban"></i>
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <b>Tableau vide !</b>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12" id="result_stat_6_nb" hidden>
                                        <div class="box">
                                            <div class="box-header">
                                                <h3 class="box-title">Nombre de calibrage</h3>
                                            </div>
                                            <div class="box-body">
                                                <div class="box-body no-padding">
                                                    <table class="table table-bordered table-striped" id="result_stat_6">
                                                        <thead>
                                                            <th><?php echo $translate->translate('Time'); ?></th>
                                                            <th><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?></th>
                                                            <th><?php echo $translate->translate('team'); ?></th>
                                                            <th><?php echo $translate->translate('NameRater'); ?></th>
                                                            <th><?php echo $translate->translate('nbCalibration'); ?></th>
                                                        </thead>
                                                        <tbody>
                                                            <tr id="result_stat_6_" hidden>
                                                                <td id="time_stats_6_nb"></td>
                                                                <td id="group_stats_6_nb"></td>
                                                                <td id="team_stats_6"></td>
                                                                <td id="name_rater_stats_6"></td>
                                                                <td id="nb_stats_6"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="box-footer pull-right">
                                                <a download="Table calibrage.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_6', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12" id="result_stat_3" hidden>
                                        <div class="box">
                                            <div class="box-header">
                                                <h3 class="box-title">Note moyenne conseiller / Note moyenne du groupe</h3>
                                            </div>
                                            <div class="box-body">
                                                <div class="box-body no-padding">
                                                    <table class="table table-bordered table-striped" id="result_stat_avg_grp">
                                                        <thead>
                                                            <th><?php echo $translate->translate('Time'); ?></th>
                                                            <th><?php echo $translate->translate('Consultant'); ?></th>
                                                            <th>Note moyenne</th>
                                                            <th>Note moyenne par groupe de CC</th>
                                                        </thead>
                                                        <tbody>
                                                            <tr>
                                                                <td id="time_stats_3"></td>
                                                                <td id="consultant_stats_3"></td>
                                                                <td id="average_mark"></td>
                                                                <td id="average_mark_grp"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="box-footer pull-right" id="average_table_export">
                                                <a download="Table average group.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_avg_grp', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="">
                <!-- TABLE 4 -->
                <div class="col-md-12">
                    <div class="box box-info col-md-12">
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingAverageCriteria'); ?> :</h3>
                        </div>
                        <form id="form_stat_4" role="form">
                            <div class="box-body col-md-12">
                                 <div id="daterange_4_div" class="form-group">
                                    <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" id="daterange_4"/>
                                    </div>
                                </div>
                                <div id="div_consult">
                                    <div id="name_consultant_stats_4_div" class="form-group">
                                        <div class="input-group">
                                            <label><?php echo $translate->translate('Consultant'); ?> :</label>
                                            <select id="name_consultant_stats_4" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                                <option value="">All</option>
                                                <?php foreach ($consultant as $value) : ?>
                                                    <option value="<?php echo $value['name_consultant'];?>"><?php echo $value['name_consultant'];?></option>
                                                <?php endforeach ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?> :</label>
                                        <select id="group_stat_4" name="group_stat_4" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                            <option value="">All</option>
                                            <?php foreach ($groups as $value) : ?>
                                                <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?> :</label>
                                        <select id="country_stat_4" name="country_stat_4" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                            <option value="">All</option>
                                            <?php foreach ($country as $value) : ?>
                                                <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('descriptionTeam'); ?> :</label>
                                        <select id="team_stat_4" name="team_stat_4" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                            <option value="">All</option>
                                            <?php foreach ($team as $value) : ?>
                                                <option value="<?php echo $value['team']; ?>"><?php echo $value['team']; ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('NameRater'); ?> :</label>
                                        <select id="name_rater_stat_4" name="name_rater_stat_4" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                            <option value="">All</option>
                                            <?php foreach ($name_rater as $value) : ?>
                                                <option value="<?php echo $value['name_rater']; ?>"><?php echo $value['name_rater']; ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label><?php echo $translate->translate('nameEval'); ?> :</label>
                                        <select id="name_form_stat_4" name="name_form_stat_4" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                            <option value="">All</option>
                                            <?php foreach ($form as $value) : ?>
                                                <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                            <?php endforeach ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="box-footer col-md-12">
                                    <div type="submit" class="btn btn-primary" onclick="generateTableAverageMarkByCriteria();">
                                        <?php echo $translate->translate('Calculate'); ?>
                                    </div>
                                    <br>
                                    <div class="box-footer col-md-12">
                                        <center id="loading_stat_4" hidden><img src="img/ajax-loader1.gif"></center>
                                        <div id="empty_table_stat_4" class="alert alert-danger alert-dismissable" hidden>
                                            <i class="fa fa-ban"></i>
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <b>Tableau vide !</b>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12" id="result_stat_4" hidden>
                                        <div class="box">
                                            <div class="box-header">
                                                <h3 class="box-title">Moyenne note / critère</h3>
                                            </div>
                                            <div class="box-body">
                                                <div class="box-body" id="result_stat_4_export">
                                                    <table class="table table-bordered table-striped" id="result_stat_avg_4">
                                                        <thead>
                                                            <th><?php echo $translate->translate('Time'); ?></th>
                                                            <th><?php echo $translate->translate('Consultant'); ?></th>
                                                            <th><?php echo $translate->translate('groupTitle'); ?></th>
                                                            <th><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?></th>
                                                            <th><?php echo $translate->translate('descriptionTeam'); ?></th>
                                                            <th><?php echo $translate->translate('NameRater'); ?></th>
                                                            <th><?php echo $translate->translate('form'); ?></th>
                                                            <th><?php echo $translate->translate('NameCriteria'); ?></th>
                                                            <th><?php echo $translate->translate('averageMark'); ?></th>
                                                        </thead>
                                                        <tbody>
                                                            <tr id="line_stat_" hidden>
                                                                <td id="daterange"></td>
                                                                <td id="consultant"></td>
                                                                <td id="group"></td>
                                                                <td id="country"></td>
                                                                <td id="team"></td>
                                                                <td id="name_rater"></td>
                                                                <td id="form_name"></td>
                                                                <td id="criteria_name"></td>
                                                                <td id="mark"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="box-footer pull-right" id="average_table_export">
                                                <a download="Table average.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_avg_4', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="">
                <!-- TABLE 5 -->
                <div class="col-md-12">
                    <div class="box box-info col-md-12">
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingUnacceptable'); ?> :</h3>
                        </div>
                        <form id="form_stat_5" role="form">
                            <div class="box-body col-md-12">
                                <div id="daterange_5_div" class="form-group">
                                    <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" id="daterange_5"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?> :</label>
                                    <select id="country_stat_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($country as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?> :</label>
                                    <select id="group_stat_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($groups as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('descriptionTeam'); ?> :</label>
                                    <select id="team_stat_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($team as $value) : ?>
                                            <option value="<?php echo $value['team']; ?>"><?php echo $value['team']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('NameRater'); ?> :</label>
                                    <select id="name_rater_stat_5" name="name_rater_stats_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($name_rater as $value) : ?>
                                            <option value="<?php echo $value['name_rater']; ?>"><?php echo $value['name_rater']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div id="name_consultant_stats_5_div" class="form-group">
                                    <label><?php echo $translate->translate('Consultant'); ?> :</label>
                                    <select id="name_consultant_stat_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($consultant as $value) : ?>
                                            <option value="<?php echo $value['name_consultant'];?>"><?php echo $value['name_consultant'];?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('nameEval'); ?> :</label>
                                    <select id="name_form_stat_5" name="name_form_stat_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($form as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                            </div>
                            <div class="box-footer col-md-12">
                                <div type="submit" class="btn btn-primary" onclick="generatableTableUnacceptable();">
                                    <?php echo $translate->translate('Calculate'); ?>
                                </div>
                                <div class="box-body">
                                    <br>
                                    <div id="empty_table_stat_5" class="alert alert-warning alert-dismissable" hidden>
                                        <i class="fa fa-ban"></i>
                                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                        <b>Tableau vide !</b>
                                    </div>
                                    <center id="loading_stat_5" hidden><img src="img/ajax-loader1.gif"></center>
                                    <div id="table_stat_5" class="box-body no-padding" hidden>
                                        <table class="table table-bordered table-striped" id="result_stat_5">
                                            <thead>
                                                <th><?php echo $translate->translate('Time'); ?></th>
                                                <th><?php echo $translate->translate('AdminNewAccountAccountCountry'); ?></th>
                                                <th><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?></th>
                                                <th><?php echo $translate->translate('descriptionTeam'); ?></th>
                                                <th><?php echo $translate->translate('NameRater'); ?></th>
                                                <th><?php echo $translate->translate('Consultant'); ?></th>
                                                <th><?php echo $translate->translate('form'); ?></th>
                                                <th><?php echo $translate->translate('NameCriteria'); ?></th>
                                                <th><?php echo $translate->translate('nbUnacceptable'); ?></th>
                                            </thead>
                                            <tbody>
                                                <tr id="result_stat_5_" hidden>
                                                    <td id="time_stat_5"></td>
                                                    <td id="country_stat_5"></td>
                                                    <td id="group_stat_5"></td>
                                                    <td id="team_stat_5"></td>
                                                    <td id="rater_stat_5"></td>
                                                    <td id="consultant_stat_5"></td>
                                                    <td id="eval_name_stat_5"></td>
                                                    <td id="criteria_name_stat_5"></td>
                                                    <td id="nb_stat_5"></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div class="box-footer pull-right" id="average_table_export">
                                            <a download="Table average.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_5', 'Table stats');">
                                                <img src='img/excell_export.png' width="10%"/>Export to Excel
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="">
                <!-- TABLE 7 -->
                <div class="col-md-12">
                    <div class="box box-info col-md-12">
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingRating'); ?> :</h3>
                            <div class="box-tools pull-right" data-toggle="tooltip">
                                <div class="btn-group" data-toggle="btn-toggle">
                                    <button id="team" type="button" class="btn btn-default type-team btn-sm active" onclick="showTeam()"><?php echo $translate->translate('team'); ?></button>
                                    <button id="group" type="button" class="btn btn-default type-team btn-sm" onclick="showGroup()"><?php echo $translate->translate('groupTitle'); ?></button>
                                </div>
                            </div>
                        </div>
                        <form id="form_stat_7" role="form">
                            <div class="box-body col-md-12">
                                <div id="daterange_7_div" class="form-group">
                                    <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" id="daterange_7"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('nameEval'); ?> :</label>
                                    <select id="name_form_stat_7" name="name_form_stat_5" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($form as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div id="team_stat_7_div" class="form-group">
                                    <label><?php echo $translate->translate('descriptionTeam'); ?> :</label>
                                    <select id="team_stat_7" name="team" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <?php foreach ($team as $value) : ?>
                                            <option value="<?php echo $value['team']; ?>"><?php echo $value['team']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div id="group_stat_7_div" class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?> :</label>
                                    <select id="group_stat_7" name="group" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <?php foreach ($groups as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="box-footer col-md-12">
                                    <div type="submit" class="btn btn-primary" onclick="generateListedConsultant();">
                                        <?php echo $translate->translate('Calculate'); ?>
                                    </div><br>
                                    <div class="box-footer col-md-12">
                                        <center id="loading_stat_7" hidden><img src="img/ajax-loader1.gif"></center>
                                        <div id="empty_table_stat_7" class="alert alert-danger alert-dismissable" hidden>
                                            <i class="fa fa-ban"></i>
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <b>Tableau vide !</b>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12" id="result_stat_7_nb" hidden>
                                        <div class="box">
                                            <div class="box-header">
                                                <h3 class="box-title">Liste :</h3>
                                            </div>
                                            <div class="box-body">
                                                <div class="box-body no-padding">
                                                    <table class="table table-bordered table-striped" id="result_stat_7">
                                                        <thead>
                                                            <th id="time_lapse"></th>
                                                            <th id="team_7"></th>
                                                            <th><span id="nb_rating_7"></span> évaluation(s) </th>
                                                            <th colspan="2"><?php echo $translate->translate('avg'); ?> : <span id="avg_rating_7"></span></th>
                                                        </thead>
                                                        <tbody>
                                                            <tr id="result_line_7_" hidden>
                                                                <td id="date"></td>
                                                                <td id="id_rating"></td>
                                                                <td id="name_consultant"></td>
                                                                <td id="name_rater"></td>
                                                                <td id="mark_and_average"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="box-footer pull-right">
                                                <a download="Table calibrage.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_7', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- TABLE 9 -->
                <div class="col-md-6">
                    <div class="box box-info col-md-12">
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingDebrief'); ?> :</h3>
                        </div>
                        <form id="form_stat_9" role="form">
                            <div class="box-body col-md-12">
                                <div id="daterange_9_div" class="form-group">
                                    <label><?php echo $translate->translate('DateEvaluation'); ?> :</label>
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                        <input type="text" class="form-control pull-right" id="daterange_9"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label><?php echo $translate->translate('AdminNewAccountAccountGroup'); ?> :</label>
                                    <select id="group_stat_9" name="group" class="form-control chosen-select" style="width:200px;" tabindex="2">
                                        <option value="">All</option>
                                        <?php foreach ($groups as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="box-footer col-md-12">
                                    <div type="submit" class="btn btn-primary" onclick="generateTableDebrief();">
                                        <?php echo $translate->translate('Calculate'); ?>
                                    </div><br>
                                    <div class="box-footer col-md-12">
                                        <div id="empty_table_stat_9" class="alert alert-danger alert-dismissable" hidden>
                                            <i class="fa fa-ban"></i>
                                            <b>Tableau vide !</b>
                                        </div>
                                    </div>
                                    <div class="box-footer col-md-12" id="result_stat_9_nb" hidden>
                                        <div class="box">
                                            <div class="box-header">
                                                <h3 class="box-title">Liste :</h3>
                                            </div>
                                            <div class="box-body">
                                                <div class="box-body no-padding">
                                                    <table class="table table-bordered table-striped" id="result_stat_9">
                                                        <thead>
                                                            <th><?php echo $translate->translate('Time'); ?></th>
                                                            <th><?php echo $translate->translate('groupTitle'); ?></th>
                                                            <th><?php echo $translate->translate('NameRater'); ?></th>
                                                            <th><?php echo $translate->translate('nbRejectedDebrief'); ?></th>
                                                            <th><?php echo $translate->translate('nbAcceptedDebrief'); ?></th>
                                                            <th><?php echo $translate->translate('total'); ?></th>
                                                        </thead>
                                                        <tbody>
                                                            <tr id="totals">
                                                                <td colspan="3"><b>Total</b></td>
                                                                <td id="total_rejected"></td>
                                                                <td id="total_validated"></td>
                                                                <td id="total_total"></td>
                                                            </tr>
                                                            <tr id="result_line_9_" hidden>
                                                                <td id="time_lapse"></td>
                                                                <td id="group"></td>
                                                                <td id="name_rater"></td>
                                                                <td id="nb_debrief_rejected"></td>
                                                                <td id="nb_debrief_validated"></td>
                                                                <td id="nb_total_debrief"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="box-footer pull-right">
                                                <a download="Table calibrage.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_9', 'Table stats');">
                                                    <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="">
                <!-- TABLE 8 -->
                <div class="col-md-12">
                    <div class="box box-info col-md-12">
                        <div class="box-header">
                            <h3 class="box-title"><?php echo $translate->translate('trackingCriteriaCalibration'); ?> :</h3>
                        </div>
                        <form id="form_stat_8" role="form">
                            <div class="box-body col-md-12">
                                <div id="calibration_8_div" class="form-group">
                                    <label><?php echo $translate->translate('calibrationList'); ?> :</label>
                                    <select id="calibration_8" class="form-control chosen-select" style="width:300px;" tabindex="2">
                                        <?php foreach ($calibration as $value) : ?>
                                            <option value="<?php echo $value['id']; ?>">
                                                <?php 
                                                    echo '# ' .  $value['id'] . ' par ' . $value['firstname'] . ' ' . $value['lastname'] . ' le ' . $value['date'];
                                                ?>
                                            </option>
                                        <?php endforeach ?>
                                    </select>
                                </div>
                                <div class="box-footer col-md-12">
                                    <div type="submit" class="btn btn-primary" onclick="generateCriteriaTableByCalibration();">
                                        <?php echo $translate->translate('Calculate'); ?>
                                    </div><br>
                                    <div class="box-footer col-md-12">
                                        <div id="empty_table_stat_8" class="alert alert-danger alert-dismissable" hidden>
                                            <i class="fa fa-ban"></i>
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <b>Tableau vide !</b>
                                        </div>
                                        <div id="criteriaByCalibration" class="box" hidden>
                                            <div class="box-header">
                                                <h3 class="box-title">Liste : </h3>
                                            </div>
                                            <div class="box-body">
                                                <div class="box-body no-padding">
                                                    <table class="table table-bordered" id="result_stat_8" style="max-width:100%; ">
                                                        <thead>
                                                            <tr>
                                                                <td><b><?php echo $translate->translate('NRating'); ?></b></td>
                                                                <td id="id_rating_0"></td>
                                                                <td id="beforeThis" hidden></td>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <tr id="criteria_mark_stat_8">
                                                            </tr>
                                                            <tr id="gap_on_twenty">
                                                                <td><b>Ecart (sur 20)</b></td>
                                                            </tr>
                                                            <tr id="gap">
                                                                <td><b>Ecart (%)</b></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                                <div class="box-footer pull-right">
                                                    <a download="Table_calibrage.xls" class="btn btn-success" onclick="return ExcellentExport.excel(this, 'result_stat_8', 'Table stats');">
                                                        <img src='img/excell_export.png' width="10%"/>Export to Excel
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div> 
                </div>
            </div>
	    </section>
    </aside>
<?php require_once('footer.php');?>
<!-- Manage tables -->
<script src="js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
<script src="js/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
<!-- Export Excel -->
<script type="text/javascript" src="js/plugins/excellentexport/excellentexport.min.js"></script>
<!-- Chosen pluggin -->
<script src="js/plugins/chosen/chosen.jquery.min.js" type="text/javascript"></script>
<!-- AJAX jquery -->
<script type="text/javascript" src="js/stats.js"></script>
<script type="text/javascript">

    $(function() {

        $('#daterange').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_2').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_3').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_4').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_5').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_6').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_7').daterangepicker({
            format: 'YYYY/MM/DD'
        });

        $('#daterange_9').daterangepicker({
            format: 'YYYY/MM/DD'
        });  
    });

    $( document ).ready(function() {
        $('#group_stat_7_div').hide();
    });
    function showTeam()
    {
        $('#team_stat_7_div').show();
        $('#group_stat_7_div').hide();
    }

    function showGroup()
    {
        $('#team_stat_7_div').hide();
        $('#group_stat_7_div').show();
    }
</script>
<script type="text/javascript">
    var config = {
      '.chosen-select'           : {}
    }
    for (var selector in config) {
      $(selector).chosen(config[selector]);
    }
</script>
